<template>
    <el-input v-model="value" :placeholder='placeholder' @change="getValue" :class="[classStyle]"></el-input>
</template>

<script>
    export default {
        data() {
            return {
                value:'',
                obj:{}
            }
        },
        props:{
            label:[String, Number],
            placeholder:{
                type:String,
                default:''
            },
            comData: {
                type: Object,
                default: () => {}
            },
            classStyle:{
                type:String,
                default:''
            }
        },
        mounted(){
            const {i_key,name,type} = this.comData
            this.obj.key = i_key
            this.obj[i_key] = this.value
            this.obj.chineseName = name
            this.obj.type = type
        },
        methods:{
            getValue(){
                this.obj[this.comData.i_key] = this.value
            },
            editValue(fieldValue){
                this.value = fieldValue
                this.getValue()
            },
            reset(){
                this.value = ''
                this.getValue()
            }
        }
    }
</script>

<style lang="less" scoped>
    .el-input.el-input--mini.dialog{
        width: 80%;
    }
</style>